//
//  PKRequestManager.h
//  PianKe
//
//  Created by lanou on 15/12/22.
//  Copyright © 2015年 MaZeGong. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CommonCrypto/CommonDigest.h> 
#import "RMMNotNetWorkView.h"

// 声明一个 block 属性 用来回调
typedef void(^Finish)(NSDictionary *dataDic);
typedef void(^Error)(NSError *errors);
typedef void(^Network)(BOOL isNetwork);
// 请求类型的枚举
typedef NS_ENUM(NSInteger, RequestType){
    POST,
    GET,
};

@interface OSRequestManager : NSObject
/**
 数据直接返回字典,适合带有刷新的页面使用

 @param urlString 请求的网址
 @param parDic 参数集合
 @param method 请求类型
 @param finish 完成回调
 @param error 错误回调
 @param view 添加进度的试图
 */
+ (void)requestWithUrlString:(NSString *)urlString
                      parDic:(NSDictionary *)parDic
                      method:(RequestType)method
                      finish:(Finish)finish
                       error:(Error)error
                       view:(UIView *)view;

/**
 没有进度提示的数据请求方法

 @param parDic 参数集合
 @param method 请求类型
 @param finish 完成回调
 @param error 错误回调
 */
+ (void)requestNoProgressWithUrlString:(NSString *)urlString
                                parDic:(NSDictionary *)parDic
                                method:(RequestType)method
                                finish:(Finish)finish
                                 error:(Error)error;
/**
 适用没有刷新的页面使用

 @param urlString <#urlString description#>
 @param parDic 参数集合
 @param method 请求类型
 @param finish 完成回调
 @param error 错误回调
 @param view 添加进度的试图
 */
+ (void)requestFWithUrlString:(NSString *)urlString parDic:(NSDictionary *)parDic method:(RequestType)method finish:(Finish)finish error:(Error)errors view:(UIView *)view;

+ (void)requestWithUrlString:(NSString *)urlString
                      parDic:(NSDictionary *)parDic
                     network:(Network)isNetwork
                      method:(RequestType)method
                      finish:(Finish)finish
                       error:(Error)error
                        view:(UIView *)view;
+ (void)requestNoProgressWithUrlString:(NSString *)urlString parDic:(NSDictionary *)parDic method:(RequestType)method finish:(Finish)finish error:(Error)errors view:(UIView *)view;

@end
